package com.wuercloud.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.wuercloud.dao.ServiceSceneDao;
import com.wuercloud.service.ServiceSceneService;

@Service("serviceSceneService")
public class ServiceSceneServiceImpl implements ServiceSceneService {
	@Autowired
	private ServiceSceneDao serviceSceneDao;

	@Override
	public void saveOrUpdate(Integer serviceId, List<Integer> sceneIdList) {
		if (sceneIdList.size() == 0) {
			return;
		}
		serviceSceneDao.delete(serviceId);
		Map<String, Object> map = new HashMap<>();
		map.put("serviceId", serviceId);
		map.put("sceneIdList", sceneIdList);
		serviceSceneDao.save(map);

	}

	@Override
	public List<Integer> querySceneIdList(Integer serviceId) {
		// TODO Auto-generated method stub
		return serviceSceneDao.querySceneIdList(serviceId);
	}

	@Override
	public void delete(Integer serviceId) {
		// TODO Auto-generated method stub
		serviceSceneDao.delete(serviceId);

	}

}
